package com.zhihuiweijian.demo.service.impl;

import com.zhihuiweijian.demo.dao.WasteMapper;
import com.zhihuiweijian.demo.model.Waste;
import com.zhihuiweijian.demo.service.WasteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class WasteServiceImpl implements WasteService {
    @Autowired
    private WasteMapper wasteMapper;

    @Override
    public void insert(Waste waste) {
        wasteMapper.insert(waste);
    }

    @Override
    public Waste findById(Integer id) {
        return wasteMapper.findById(id);
    }

    @Override
    public void updateCollect(Integer id, Integer collectManId, String collectManName, Date date) {
        wasteMapper.updateCollect(id,collectManId,collectManName,date);
    }

    @Override
    public void updateWareHouse(Integer id, Integer warehouseManId, String warehouseManName, Date date) {
        wasteMapper.updateWareHouse(id,warehouseManId,warehouseManName,date);
    }

    @Override
    public void updateTransfer(Integer id, Integer transferManId, String transferManName, Date date) {
        wasteMapper.updateTransfer(id,transferManId,transferManName,date);
    }

    @Override
    public void updateRuin(Integer id, Integer ruinManId, String ruinManName, Date date) {
        wasteMapper.updateRuin(id,ruinManId,ruinManName,date);
    }

    @Override
    public void updateError(Integer id, Integer errorManId, String errorManName, Date date) {
        wasteMapper.updateError(id,errorManId,errorManName,date);
    }

    @Override
    public List<Waste> findAll() {
        return wasteMapper.findAll();
    }

    @Override
    public List<Waste> findByHospitalId(Integer id) {
        return wasteMapper.findByHospitalId(id);
    }

    @Override
    public List<Waste> findByDate(Date d1, Date d2) {
        return wasteMapper.findByDate(d1,d2);
    }

}
